package Test;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你要存入的金额");
        int qian = sc.nextInt();
        if(qian < 1000){
            System.out.println("存入金额不能小于1000元");
            return;
        }else {
            System.out.println("请输入你要存入金额的年限（1,2,3,5）");
            int year = sc.nextInt();
            System.out.println("你存入的金额为：" + qian + "元");
            switch (year){
                case 1:
                    System.out.println("到期后本息为：" + qian * 1.0225);
                    break;
                case 2:
                    System.out.println("到期后本息为：" + qian * 1.027 * 2);
                    break;
                case 3:
                    System.out.println("到期后本息为：" + qian * 1.0315 * 3);
                    break;
                case 5:
                    System.out.println("到期后本息为：" + qian * 1.0375 * 5);
                    break;
                default:
                    System.out.println("输入年限有误");
            }
        }

    }
}
